package com.squid.templateProject.utils;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.squid.templateProject.bean.resp.PageResp;

/**
 * Description
 *
 * @author jinhang
 * @since 2024-1-24
 **/
public class LimitUtils {
    public static <T> PageResp<T> formatResponse(IPage<T> data) {
        PageResp<T> response = new PageResp<>();
        response.setPageData(data.getRecords());
        response.setCount((int) data.getTotal());
        response.setPageNum((int) data.getCurrent());
        return response;
    }
}
